<template>
	<view class="body">
		<scroll-view scroll-y="true" class="scroll-view-Y">
			<u-parse :html="content"></u-parse>
		</scroll-view>
		<view class="foot">
			<view class="btn" @click="become">
				{{becomeQuery.state == 1?'申请审核中':becomeQuery.state ==2?'通过':becomeQuery.state == 4?'完善资料':'申请成为教练'}}
			</view>
		</view>
	</view>
</template>

<script>
	import{
		publicity,coachInfo
	} from '@/api/apply.js'
	export default {
		data() {
			return {
				content: '',
				becomeQuery:{}
			}
		},
		onLoad() {
			this.getpublicity()
			this.getcoachInfo()
		},
		methods: {
			getcoachInfo() {
				coachInfo().then(({
					data: res
				}) => {
					console.log('res', res);
					if (res.code == 1) {
						this.becomeQuery = res.data
					}
				})
			},
			become() {
				if (this.becomeQuery.state == 4 || this.becomeQuery.state == 0) {
					this.$ROUTELINK('Apply_coach')
				}
			},
			getpublicity(){
				publicity().then(({data:res})=>{
					console.log('res', res);
					if(res.code == 1){
						this.content = res.data.content
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #e9e9e9;
	}

	.body {
		display: flex;
		flex-direction: column;
		align-items: center;

		.scroll-view-Y {
			width: 100%;
			height: 90vh;
		}
	}

	.foot {
		position: fixed;
		bottom: 0;
		width: 750rpx;
		height: 160rpx;
		background: #ffffff;
		box-shadow: 0rpx 8rpx 28rpx 0rpx rgba(166, 179, 194, 0.30);
		padding-top: 16rpx;
		display: flex;
		justify-content: center;

		.btn {
			width: 710rpx;
			height: 88rpx;
			background: #73F0EA;
			border-radius: 16rpx;
			font-size: 34rpx;
			font-family: PingFang SC, PingFang SC-Bold;
			font-weight: 700;
			color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>